//
//  Extension+String.swift
//  AirTravel
//
//  Created by 许必成 on 2021/11/27.
//

import UIKit

extension String{
    
    
    func formatTimeStamp(format:String = "yyyy-MM-dd HH:mm") -> String {
        let timeInterval = TimeInterval(self) ?? 0
        let date = Date.init(timeIntervalSince1970: timeInterval)
        let dateFormatte = DateFormatter()
        dateFormatte.dateFormat = format
        return dateFormatte.string(from: date)
    }
    
}
